#version 330 core
out vec4 FragColor;

in vec2 TexCoord;

// texture samplers
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform float mixValue;

void main()
{
	vec4 texColor1 = texture(texture1, TexCoord);

	vec2 TexCoordXFlip = vec2(1-TexCoord.x,TexCoord.y);
	vec4 texColor2 = texture(texture2, TexCoordXFlip);

	//vec4 texColor2 = texture(texture2, TexCoord);
	// mix(x,y,a) = x*(1−a)+y*a   hlsl对应的是lerp 

	vec4 texCombined = mix(texColor1, texColor2, mixValue);
	FragColor.xyz = texCombined.xyz;
	FragColor.w = 1.0;
}